<?php
declare(strict_types=1);

namespace ServerApp\lib\server\tcp;

use Swoole\Server;

/**
 * Interface ITcp
 * @package ServerApp\lib\server\tcp
 */
interface ITcp
{
    public function workerStart();

    /**
     * @param Server $server
     * @param $fd
     * @param $from_id
     * @param $data
     * @param Tcp $self
     * @return mixed
     */
    public function receive(Server $server, $fd, $from_id, $data, Tcp $self);

//    /**
//     * @param $to
//     * @param $mid
//     * @param string $data
//     */
//    public function udpReceiver($to, $mid, $data): void;

//    /**
//     * @param string $data
//     */
//    public function longTaskReceiver(string $data): void;

    public function getLongTasks(): array;

    /**
     *
     */
    public function getName(): string;

//    /**
//     * @return string
//     */
//    public function buildOneHeartMsg(): string;

    /**
     * @return array
     */
    public function getMsgQArr(): array ;
//    public function getMsgQMsg($instance, $channelName, $message): void;

    public function getServiceInstance();

    public function fdClose(int $fd, $deviceId);
    public function fdConnect(int $fd);
}